home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: C type question
- Date: 2 Feb 1996 07:35 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <2FEB199607353567@erich.triumf.ca>
- References: <Pine.SUN.3.91.960202131027.20090A-100000@sun19.cs.cuhk.hk>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <Pine.SUN.3.91.960202131027.20090A-100000@sun19.cs.cuhk.hk>, Cheung ming wai <mwcheung@cs.cuhk.hk> writes...
- >Hi,
- >
- >I've some problems about my following program:
- >The program should be run under PC.
- >=========
- >/* program to find the smallest +ve number */
- >#include <stdio.h>
- >
- >main(void)
- >{
- > long double u, v;
- > u = v = 0.5;
- > while((1+u) > 1) {
- > v = u;
- > u /= 2;
- > }
- > printf("The smallest number (1+u)>1 is: %e.\n", v);
-
- %e just prints a plain float. For long double, you need %Le.
-
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-
-
-
-
-
-
-
-
-
-
-